<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>山东旅游网</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.css">
    <link rel="stylesheet" href="styles.css">
    <script type="text/javascript">
        // 检查是否有错误信息
        function showError() {
            var errorMsg = "<%= request.getAttribute("errorMsg") %>";
            if (errorMsg !== "null") {
                alert(errorMsg); // 弹出提示框
                document.getElementById("password").value = ""; // 清空密码输入框
            }
        }
        // 页面加载时调用
        window.onload = showError;
    </script>
</head>

<body>
    <header>
        <div class="logo">山东旅游网</div>
        <div class="user-actions">
            <a href="register.jsp">注册</a>
            <a href="index.jsp">登录</a>
        </div>
    </header>
   
    <main>
        <div class="slider-wrapper">
            <div class="slider-container">
                <div class="slider-main" id="slider">
                    <div><img src="./images/LunBoTu_1.jpg" ></div>
                    <div><img src="./images/LunBoTu_2.jpg" ></div>
                    <div><img src="./images/LunBoTu_3.jpg" ></div>
                </div>
            </div>
        </div>
        <div class="register-form">
            <h2>用户登录</h2>
            <form action="indexservlet" method="post">
                <label for="username">用户名：</label>
                <input type="text" id="username" name="username" placeholder="请输入用户名">
                <label for="password">密码：</label>
                <input type="password" id="password" name="password" placeholder="请输入密码">
                <input type="submit" value="确定" class="submit-btn">
            </form>
        </div>   
    </main>
   
    <footer>
        <div class="footer-container">
            <div class="footer-text">
                <p>
                    <span>Copyright © 2024</span>
                    <span>山东建筑大学</span>
                </p>
            </div>
        </div>
    </footer>

    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.min.js"></script>
    
</body>

<style>
    body {
        margin: 0;
        padding: 0;
        font-family: Arial, sans-serif;
        display: flex;
        flex-direction: column;
    }

    header {
        background-color: white;
        display: flex;
        justify-content: space-between;
        height: 60px;
        align-items: center;
        padding: 10px 20px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .logo {
        color: orange;
        font-size: 24px;
        font-weight: bold;
    }

    .user-actions a {
        margin-left: 20px;
        text-decoration: none;
        color: gray;
    }

    .user-actions a:hover {
        color: black;
    }

    main {
        flex: 1;
        text-align: center;
    }

    .slider-wrapper {
        width: 1400px;
        margin: 0 auto;
    }

    .slider-container {
        margin-top: 20px;
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .slider-main {
        display: flex;
        width: 100%;
        overflow: hidden;
        position: relative;
    }

    .slider-main img {
        width: 100%;
        height: 300px;
        flex-shrink: 0;
    }
    
    .register-form {
        width: 400px;
        margin: 80px auto;
        padding: 20px;
        border: 1px solid #ccc;
        border-radius: 5px;
        background-color: white;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

    h2 {
        text-align: center;
        color: #333;
    }

    form label {
        display: block;
        margin-top: 10px;
        color: #555;
    }

    input[type="text"],
    input[type="password"] {
        width: 95%;
        padding: 10px;
        margin-top: 5px;
        border: 1px solid #ccc;
        border-radius: 3px;
    }

    .submit-btn {
        background-color: green;
        color: white;
        padding: 10px 20px;
        border: none;
        border-radius: 3px;
        cursor: pointer;
        margin-top: 15px;
    }

    footer {
        background-color: green;
        color: white;
        padding: 15px 0;
        width: 100%;
        height: 40px;
    }

    .footer-container {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }

    .footer-left {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-text {
        text-align: center;
    }
</style>

<script>
    $(document).ready(function () {
        $('#slider').slick({
            autoplay: true,
            autoplaySpeed: 2000,
            dots: false,
            arrows: false
        });
    });
</script>

</html>